basepath=$(cd `dirname $0`; pwd)
echo ${basepath}

cd ${basepath}/Yao3rdPart/

FFMPEG=ffmpeg-n4.4.2

chmod -R 777 ${FFMPEG}

cd ${basepath}/Yao3rdPart/${FFMPEG}/


./configure \
--prefix=${basepath}/Yao3rdPart/FFmpeg-n4.4.2/ffmpeg_install/

make clean
make -j8
make install

cd ${basepath}

if [ ! -d ./Lib ];then
    mkdir Lib
fi

cd ${basepath}/Lib

if [ -d ./ffmpeg_install ];then
    rm -r ffmpeg_install
fi

cd ${basepath}

cp -r Yao3rdPart/${FFMPEG}/ffmpeg_install Lib/ffmpeg_install

rm -r Yao3rdPart/${FFMPEG}/ffmpeg_install